<%@ page language="java" import="java.util.*,entity.*,dao.*,dao.impl.*" pageEncoding="utf-8"%>
<%
request.setCharacterEncoding("utf-8");
String userName =request.getParameter("userName");
String userPass = request.getParameter("userPass");
String head=request.getParameter("head");
int gender =Integer.parseInt(request.getParameter("gender"));
UserDao userDao = new UserDaoImpl();
User user =new User();
user.setUName(userName);
user.setUPass(userPass);
user.setHead(head);
user.setGender(gender);
int num=userDao.addUser(user);
if(num == 1){
	response.sendRedirect("../index.jsp");
	}else{
		response.sendRedirect("../reg.jsp");
	}
%>